/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gob.cgr.sgrh.ejb.entidad;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author MICROSOF
 */
@Entity
@Table(name = "estudio_basico")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "EstudioBasico.findAll", query = "SELECT e FROM EstudioBasico e"),
    @NamedQuery(name = "EstudioBasico.findByIdEstudioBasico", query = "SELECT e FROM EstudioBasico e WHERE e.idEstudioBasico = :idEstudioBasico"),
    @NamedQuery(name = "EstudioBasico.findByTipoEstudio", query = "SELECT e FROM EstudioBasico e WHERE e.tipoEstudio = :tipoEstudio"),
    @NamedQuery(name = "EstudioBasico.findByColegio", query = "SELECT e FROM EstudioBasico e WHERE e.colegio = :colegio"),
    @NamedQuery(name = "EstudioBasico.findByFechaInicio", query = "SELECT e FROM EstudioBasico e WHERE e.fechaInicio = :fechaInicio"),
    @NamedQuery(name = "EstudioBasico.findByFechaFin", query = "SELECT e FROM EstudioBasico e WHERE e.fechaFin = :fechaFin"),
    @NamedQuery(name = "EstudioBasico.findByVerificado", query = "SELECT e FROM EstudioBasico e WHERE e.verificado = :verificado"),
    @NamedQuery(name = "EstudioBasico.listarPorIdPersona", query = "SELECT e FROM EstudioBasico e WHERE e.idPersona.idPersona = :idPersona")})
public class EstudioBasico implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id 
    @Basic(optional = false)
    @Column(name = "ID_ESTUDIO_BASICO")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer idEstudioBasico;
    @Size(max = 45)
    @Column(name = "TIPO_ESTUDIO")
    private String tipoEstudio;
    @Size(max = 255)
    @Column(name = "COLEGIO")
    private String colegio;
    @Column(name = "FECHA_INICIO")
    @Temporal(TemporalType.DATE)
    private Date fechaInicio;
    @Column(name = "FECHA_FIN")
    @Temporal(TemporalType.DATE)
    private Date fechaFin;
    @Size(max = 1)
    @Column(name = "VERIFICADO")
    private String verificado;
    @JoinColumn(name = "ID_PERSONA", referencedColumnName = "ID_PERSONA")
    @ManyToOne(optional = false)
    private Persona idPersona;

    public EstudioBasico() {
    }

    public EstudioBasico(Integer idEstudioBasico) {
        this.idEstudioBasico = idEstudioBasico;
    }

    public Integer getIdEstudioBasico() {
        return idEstudioBasico;
    }

    public void setIdEstudioBasico(Integer idEstudioBasico) {
        this.idEstudioBasico = idEstudioBasico;
    }

    public String getTipoEstudio() {
        return tipoEstudio;
    }

    public void setTipoEstudio(String tipoEstudio) {
        this.tipoEstudio = tipoEstudio;
    }

    public String getColegio() {
        return colegio;
    }

    public void setColegio(String colegio) {
        this.colegio = colegio;
    }

    public Date getFechaInicio() {
        return fechaInicio;
    }

    public void setFechaInicio(Date fechaInicio) {
        this.fechaInicio = fechaInicio;
    }

    public Date getFechaFin() {
        return fechaFin;
    }

    public void setFechaFin(Date fechaFin) {
        this.fechaFin = fechaFin;
    }

    public String getVerificado() {
        return verificado;
    }

    public void setVerificado(String verificado) {
        this.verificado = verificado;
    }

    public Persona getIdPersona() {
        return idPersona;
    }

    public void setIdPersona(Persona idPersona) {
        this.idPersona = idPersona;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idEstudioBasico != null ? idEstudioBasico.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EstudioBasico)) {
            return false;
        }
        EstudioBasico other = (EstudioBasico) object;
        if ((this.idEstudioBasico == null && other.idEstudioBasico != null) || (this.idEstudioBasico != null && !this.idEstudioBasico.equals(other.idEstudioBasico))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "gob.cgr.sgrh.ejb.entidad.EstudioBasico[ idEstudioBasico=" + idEstudioBasico + " ]";
    }
    
}
